import { axios } from '@/utils/request'

export function customerPage (params) {
  return axios({
    url: '/user/page',
    method: 'get',
    params: params
  })
}

export function addCustomer (params) {
  console.log('addCustomer.params', params)
  return axios({
    url: '/user',
    method: 'post',
    data: params
  })
}

export function updateCustomer (params) {
  return axios({
    url: '/user/' + params.id,
    method: 'put',
    data: params
  })
}

export function deleteCustomer (params) {
  return axios({
    url: '/user/' + params.id,
    method: 'delete'
  })
}

export function applyList (params) {
  return axios({
    url: '/stock/user/' + params.customerId,
    method: 'get'
  })
}

export function deleteApply (params) {
  return axios({
    url: '/stock/apply/' + params.id,
    method: 'delete'
  })
}

export function updateApplyStatus (params) {
  return axios({
    url: '/stock/apply/' + params.id,
    method: 'put',
    data: params
  })
}
